﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataTier.Helpers
{
    public static class ProductDictionaryHelper
    {
        public static Dictionary<int, int> Except(Dictionary<int, int> first, Dictionary<int, int> second)
        {
            Dictionary<int, int> notequalsProducts = new Dictionary<int, int>();
            foreach (var f in first)
            {
                if (!second.ContainsKey(f.Key))
                    notequalsProducts.Add(f.Key, f.Value);
                else if (second[f.Key] < f.Value)
                    notequalsProducts.Add(f.Key, f.Value - second[f.Key]);
            }

            return notequalsProducts;
        }
    }
}
